/*
package com.yjps.company.service;

import com.yjps.company.dao.ResumeDao;
import com.yjps.company.model.Resume;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

*/
/**
 * Created by 麒全 on 2015/8/18.
 *//*

@Service
public class ResumeService {
    @Autowired
    ResumeDao resumeDao;

    private static final Logger log = LoggerFactory.getLogger(ResumeService.class);

    @Transactional
    public List<Resume> getList() {
        String hql = "from Resume r where r.valid=1";

        return resumeDao.find(hql);
    }

    @Transactional
    public Resume find(int id) {
        String hql = "from Resume r where r.id = :id";
        Map<String, Object> map = new HashMap<>();
        map.put("id", id);
        return (Resume) resumeDao.findUniqueResult(hql, map);

    }

    @Transactional
    public void add(Resume r) {
        resumeDao.save(r);
    }

    @Transactional
    public boolean update(Resume r) {
        Resume localResume = resumeDao.get(r.getId());
        if (localResume!=null || localResume.isValid() == 0) {
            return false;
        }
        resumeDao.update(r);
        return true;
    }

    @Transactional
    public void delete(Resume r) {
        resumeDao.invalid(r);
        log.debug("delete the Resume success, id is " + r.getId());

    }

}
*/
